package test.maven;

import java.util.Map;

import com.google.gson.Gson;

public class Obj {
	
	private int _id;
	
	private String _name;

	public int get_id() {
		return _id;
	}

	public void set_id(int _id) {
		this._id = _id;
	}

	public String get_name() {
		return _name;
	}

	public void set_name(String _name) {
		this._name = _name;
	}
	
	public static void main(String[] args) {
		Obj obj = new Obj();
		obj.set_id(1);
		obj.set_name("zhangsan");
		String jsonstr = new Gson().toJson(obj);
		@SuppressWarnings("rawtypes")
		Map map = new Gson().fromJson(jsonstr, Map.class);
		System.out.println(map);
	}

}
